package com.example.demo.mapper;

import com.example.demo.admin.dto.SearchDto;

import com.example.demo.admin.pojo.Job;
import com.example.demo.admin.vo.DepartmentVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface JobMapper {


    @Select("select id,name from job;")
    List<DepartmentVO> getJobs();

    Page<Job> getAllJob(SearchDto searchDto);
    @Select("delete from job where id=#{id}")
    void deleteJobById(Long id);

    @Insert("insert into job(name,create_time,update_time) values (#{name},#{createTime},#{updateTime}) ")
    void addJob(Job job);

    @Update("update job set name=#{name},update_time =#{updateTime} where id=#{id}")
    void editJob(Job job);
}
